package cn.school.wechat.utils;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author: lx
 * @date: 2024/1/9 9:37
 * @description: 模板消息参数
 */
public class WeChatParamUtil {

    /**
     * 到校、离校参数
     * @param thing2Value 姓名
     * @param thing4Value 地点
     * @param time3Value 时间
     * @return
     */
    public static Map<String, Object> getArriveOrLeaveSchoolParam (String thing2Value,
                                                                   String thing4Value,
                                                                   String time3Value) {

        Map<String, Object> objMap = new HashMap<>(3);
        Map<String, String> map = new HashMap<>(1);
        // 姓名
        map.put("value", thing2Value);
        objMap.put("thing2", map);
        // 地点
        map = new HashMap<>(1);
        map.put("value", thing4Value);
        objMap.put("thing4", map);
        // 时间
        map = new HashMap<>(1);
        map.put("value", time3Value);
        objMap.put("time3", map);
        return objMap;
    }

    /**
     * 考勤结果通知模板
     * @param thing10Value 考勤名称
     * @param thing7Value 姓名
     * @param thing4Value 考勤位置
     * @param thing5Value 考勤状态
     * @param time2Value 考勤时间
     * @return
     */
    public static Map<String, Object> getAttendanceResultParam (String thing7Value,
                                                                String thing10Value,
                                                                String thing4Value,
                                                                String thing5Value,
                                                                String time2Value) {

        Map<String, Object> objMap = new HashMap<>(5);
        Map<String, String> map = new HashMap<>(1);
        map.put("value", thing7Value);
        objMap.put("thing7", map);

        map = new HashMap<>(1);
        map.put("value", thing10Value);
        objMap.put("thing10", map);

        map = new HashMap<>(1);
        map.put("value", thing4Value);
        objMap.put("thing4", map);

        map = new HashMap<>(1);
        map.put("value", thing5Value);
        objMap.put("thing5", map);

        map = new HashMap<>(1);
        map.put("value", time2Value);
        objMap.put("time2", map);
        return objMap;
    }

    /**
     * 学生未归考勤通知班主任
     * @param thing7Value 姓名
     * @param thing1Value 班级
     * @param thing5Value 考勤状态
     * @return
     */
    public static Map<String, Object> absenceStuNtClsTeacherParam(String thing7Value,
                                                                   String thing1Value,
                                                                   String thing5Value) {

        Map<String, Object> objMap = new HashMap<>(3);
        Map<String, String> map = new HashMap<>(1);
        // 姓名
        map.put("value", thing7Value);
        objMap.put("thing7", map);
        // 地点
        map = new HashMap<>(1);
        map.put("value", thing1Value);
        objMap.put("thing1", map);
        // 时间
        map = new HashMap<>(1);
        map.put("value", thing5Value);
        objMap.put("thing5", map);
        return objMap;
    }

    /**
     * 学生请假通知参数
     * @param thing1Value 学生姓名
     * @param thing7Value 班级名称
     * @param time3Value 开始时间
     * @param time4Value 结束时间
     * @return
     */
    public static Map<String, Object> getStudentLeaveNoticeParam (String thing1Value,
                                                                String thing7Value,
                                                                Date time3Value,
                                                                Date time4Value) {

        Map<String, Object> objMap = new HashMap<>(4);

        Map<String, String> map = new HashMap<>(1);
        map.put("value", thing1Value);
        objMap.put("thing1", map);

        map = new HashMap<>(1);
        map.put("value", thing7Value);
        objMap.put("thing7", map);

        Map<String, Date> mapDate = new HashMap<>(1);
        mapDate.put("value", time3Value);
        objMap.put("time3", mapDate);

        mapDate = new HashMap<>(1);
        mapDate.put("value", time4Value);
        objMap.put("time4", mapDate);

        return objMap;
    }
}
